﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using App.Domain.Model;
using App.DAL.EF;
using System.Configuration;

namespace App.Composers
{
    public class DomainComposer
    {
        private static DomainComposer instance = null;
        private DomainComposer()
        {
            Init();
        }

        private string connectionString = null;
        private IRepository rep = null;
        private void Init()
        {
            connectionString = ConfigurationManager.ConnectionStrings["SqlConnection"].ConnectionString;
            rep = new EFRepository(connectionString);
            BusinessLogic = new Logic(rep);
        }
        public static DomainComposer Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new DomainComposer();
                }
                return instance;
            }
        }
        public Logic BusinessLogic { get; private set; }
    }
}
